package com.xywl.escort.utils;

import android.app.Application;
import android.content.Context;

import com.xywl.escort.NmApplication;

import timber.log.Timber;

import static com.xywl.escort.common.PreferenceKeys.TOKEN;

public class LoginStateUtil {
    private LoginStateUtil() {
    }

    private volatile static LoginStateUtil instance;

    public static LoginStateUtil getInstance() {
        if (instance == null) {
            synchronized (LoginStateUtil.class) {
                if (instance == null) {
                    instance = new LoginStateUtil();
                }
            }
        }
        return instance;
    }

    public boolean checkLoginAndRequestLogin(Context context) {
        return true;
    }

    public String getToken(Application application) {
        Timber.tag("LoginStateUtil").e("application=" + application);
        return RxSPTool.getString(application, TOKEN);
    }
}